VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "mswinsck.ocx"
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "richtx32.ocx"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{48E59290-9880-11CF-9754-00AA00C00908}#1.0#0"; "MSINET.OCX"
Begin VB.Form frmChat 
   ClientHeight    =   6420
   ClientLeft      =   165
   ClientTop       =   555
   ClientWidth     =   11610
   DrawMode        =   7  'Invert
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   6420
   ScaleWidth      =   11610
   StartUpPosition =   2  'CenterScreen
   Begin VB.Timer tmrYouGotKicked 
      Enabled         =   0   'False
      Interval        =   5000
      Left            =   2520
      Top             =   5640
   End
   Begin VB.Timer tmrTransparent 
      Enabled         =   0   'False
      Interval        =   100
      Left            =   2040
      Top             =   5640
   End
   Begin VB.Timer tmrUpdater 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   2400
      Top             =   5160
   End
   Begin VB.Timer tmrBotNews 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   1920
      Top             =   5160
   End
   Begin VB.TextBox txtAuth 
      Appearance      =   0  'Flat
      BackColor       =   &H00000000&
      ForeColor       =   &H0000FFFF&
      Height          =   285
      Left            =   5160
      Locked          =   -1  'True
      TabIndex        =   13
      Top             =   7920
      Visible         =   0   'False
      Width           =   3135
   End
   Begin VB.TextBox txtChannel 
      Alignment       =   2  'Center
      BackColor       =   &H00000000&
      ForeColor       =   &H00808080&
      Height          =   285
      Left            =   9000
      Locked          =   -1  'True
      TabIndex        =   12
      Top             =   0
      Width           =   2595
   End
   Begin VB.TextBox txtFriends 
      Alignment       =   2  'Center
      BackColor       =   &H00000000&
      ForeColor       =   &H00808080&
      Height          =   285
      Left            =   9000
      Locked          =   -1  'True
      TabIndex        =   11
      Top             =   0
      Width           =   2595
   End
   Begin VB.TextBox txtAdmins 
      Alignment       =   2  'Center
      BackColor       =   &H00000000&
      ForeColor       =   &H00808080&
      Height          =   285
      Left            =   9000
      Locked          =   -1  'True
      TabIndex        =   10
      Text            =   "Total Server (Admins)"
      Top             =   0
      Width           =   2595
   End
   Begin MSComctlLib.ListView ChanList 
      Height          =   5895
      Left            =   9000
      TabIndex        =   9
      Top             =   240
      Width           =   2595
      _ExtentX        =   4577
      _ExtentY        =   10398
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      HideColumnHeaders=   -1  'True
      _Version        =   393217
      SmallIcons      =   "ImageList"
      ForeColor       =   65535
      BackColor       =   0
      Appearance      =   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      NumItems        =   1
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Object.Width           =   4143
      EndProperty
   End
   Begin MSComctlLib.ListView FriendsList 
      Height          =   5895
      Left            =   9000
      TabIndex        =   8
      Top             =   240
      Width           =   2595
      _ExtentX        =   4577
      _ExtentY        =   10398
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      HideColumnHeaders=   -1  'True
      _Version        =   393217
      SmallIcons      =   "ImageList"
      ForeColor       =   65535
      BackColor       =   0
      Appearance      =   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      NumItems        =   1
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Object.Width           =   4143
      EndProperty
   End
   Begin MSComctlLib.ListView lstAdmins 
      Height          =   5895
      Left            =   9000
      TabIndex        =   7
      Top             =   240
      Width           =   2595
      _ExtentX        =   4577
      _ExtentY        =   10398
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      HideColumnHeaders=   -1  'True
      _Version        =   393217
      SmallIcons      =   "ImageList"
      ForeColor       =   65535
      BackColor       =   0
      Appearance      =   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      NumItems        =   1
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Object.Width           =   4143
      EndProperty
   End
   Begin InetCtlsObjects.Inet InetReadme 
      Left            =   1320
      Top             =   5040
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
   End
   Begin MSComctlLib.ImageList ImageList 
      Left            =   120
      Top             =   5040
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   32
      ImageHeight     =   32
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   3
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form1.frx":0CCA
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form1.frx":15A4
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "Form1.frx":17B1
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin InetCtlsObjects.Inet InetNews 
      Left            =   720
      Top             =   5040
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      Protocol        =   4
      RemoteHost      =   "d2site.com"
      URL             =   "http://d2site.com/vnbot/text/2.0/news.txt"
      Document        =   "/vnbot/text/2.0/news.txt"
   End
   Begin VB.Timer tmrDelayMS 
      Enabled         =   0   'False
      Interval        =   100
      Left            =   1560
      Top             =   5640
   End
   Begin MSComctlLib.TabStrip TabStrip1 
      Height          =   255
      Left            =   9045
      TabIndex        =   6
      Top             =   6120
      Width           =   2610
      _ExtentX        =   4604
      _ExtentY        =   450
      MultiRow        =   -1  'True
      HotTracking     =   -1  'True
      Separators      =   -1  'True
      _Version        =   393216
      BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628} 
         NumTabs         =   3
         BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Channel"
            ImageVarType    =   2
         EndProperty
         BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Friends List"
            ImageVarType    =   2
         EndProperty
         BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Admins"
            ImageVarType    =   2
         EndProperty
      EndProperty
   End
   Begin VB.Timer tmrIdle 
      Enabled         =   0   'False
      Interval        =   60000
      Left            =   1080
      Top             =   5640
   End
   Begin VB.Timer tmrCheckState 
      Enabled         =   0   'False
      Interval        =   4000
      Left            =   600
      Top             =   5640
   End
   Begin MSWinsockLib.Winsock sckVectorNet 
      Left            =   120
      Top             =   5640
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin VB.ComboBox txtSendChat 
      BackColor       =   &H00000000&
      ForeColor       =   &H00FFFFFF&
      Height          =   315
      Left            =   0
      TabIndex        =   1
      Top             =   6120
      Width           =   9060
   End
   Begin RichTextLib.RichTextBox rtbchat 
      Height          =   6135
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   8970
      _ExtentX        =   15822
      _ExtentY        =   10821
      _Version        =   393217
      BackColor       =   0
      BorderStyle     =   0
      Enabled         =   -1  'True
      ReadOnly        =   -1  'True
      ScrollBars      =   2
      TextRTF         =   $"Form1.frx":1DA1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial Baltic"
         Size            =   9.75
         Charset         =   186
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Label Label2 
      Caption         =   "Label2"
      Height          =   15
      Left            =   6000
      TabIndex        =   5
      Top             =   6600
      Visible         =   0   'False
      Width           =   2775
   End
   Begin VB.Label Label1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      Caption         =   "Label1"
      ForeColor       =   &H80000008&
      Height          =   135
      Left            =   3360
      TabIndex        =   4
      Top             =   6480
      Visible         =   0   'False
      Width           =   1695
   End
   Begin VB.Label lblSpacer2 
      Caption         =   "Label1"
      Height          =   15
      Left            =   0
      TabIndex        =   3
      Top             =   0
      Width           =   2295
   End
   Begin VB.Label lblSpacer 
      Caption         =   "Label1"
      Height          =   135
      Left            =   5040
      TabIndex        =   2
      Top             =   6480
      Visible         =   0   'False
      Width           =   2295
   End
   Begin VB.Menu Settings 
      Caption         =   "Bot"
      Begin VB.Menu mnuPopup 
         Caption         =   "RightMemberPopUp"
         Visible         =   0   'False
         Begin VB.Menu mnuPopupWhisper 
            Caption         =   "Whisper User"
         End
         Begin VB.Menu mnuPopupWhois 
            Caption         =   "Whois"
         End
         Begin VB.Menu gergrg 
            Caption         =   "-"
         End
         Begin VB.Menu mnuPopupKick 
            Caption         =   "Kick"
            Enabled         =   0   'False
         End
         Begin VB.Menu mnuPopupBan 
            Caption         =   "Ban"
            Enabled         =   0   'False
         End
         Begin VB.Menu weedf 
            Caption         =   "-"
            Index           =   1
         End
         Begin VB.Menu UserProfile 
            Caption         =   "Users profile"
            Enabled         =   0   'False
         End
      End
      Begin VB.Menu mnuChat 
         Caption         =   "ChatMenuPopUp"
         Enabled         =   0   'False
         Visible         =   0   'False
         Begin VB.Menu mnuPopupTest 
            Caption         =   "Test Menu"
         End
      End
      Begin VB.Menu Connection 
         Caption         =   "Connection"
         Shortcut        =   ^N
      End
      Begin VB.Menu Disconnection 
         Caption         =   "Disconnect"
         Shortcut        =   ^B
      End
      Begin VB.Menu userdb 
         Caption         =   "User Database"
         Shortcut        =   ^J
      End
      Begin VB.Menu trbssv 
         Caption         =   "-"
         Index           =   1
      End
      Begin VB.Menu CfUs 
         Caption         =   "Check for Updates"
         Shortcut        =   ^Z
      End
      Begin VB.Menu QuickChannelList 
         Caption         =   "Quick Channels"
         WindowList      =   -1  'True
         Begin VB.Menu QuickChans 
            Caption         =   "Edit Channels"
            Shortcut        =   ^Q
         End
         Begin VB.Menu bntkjg 
            Caption         =   "-"
         End
         Begin VB.Menu Chan1 
            Caption         =   "Channel1"
            Shortcut        =   {F3}
         End
         Begin VB.Menu Chan2 
            Caption         =   "Channel2"
            Shortcut        =   {F4}
         End
         Begin VB.Menu Chan3 
            Caption         =   "Channel3"
            Shortcut        =   {F5}
         End
         Begin VB.Menu Chan4 
            Caption         =   "Channel4"
            Shortcut        =   {F6}
         End
         Begin VB.Menu Chan5 
            Caption         =   "Channel5"
            Shortcut        =   {F7}
         End
         Begin VB.Menu Chan6 
            Caption         =   "Channel6"
            Shortcut        =   {F8}
         End
         Begin VB.Menu Chan7 
            Caption         =   "Channel7"
            Shortcut        =   {F9}
         End
      End
      Begin VB.Menu etbrtgbh 
         Caption         =   "-"
      End
      Begin VB.Menu ExitVNB 
         Caption         =   "Exit VectorNet Bot"
         Shortcut        =   ^E
      End
   End
   Begin VB.Menu TheSettings 
      Caption         =   "Bot Settings"
      Begin VB.Menu Config 
         Caption         =   "Global Configuration"
         Shortcut        =   ^P
      End
      Begin VB.Menu ewgghrt 
         Caption         =   "-"
      End
      Begin VB.Menu ProfileEdit 
         Caption         =   "Edit Profile"
         Enabled         =   0   'False
         Shortcut        =   ^{F4}
      End
      Begin VB.Menu EditF 
         Caption         =   "Edit Files"
         Begin VB.Menu BotFolder 
            Caption         =   "Open Bot Folder"
            Shortcut        =   ^O
         End
         Begin VB.Menu Configini 
            Caption         =   "Config"
            Shortcut        =   ^G
         End
         Begin VB.Menu UserD 
            Caption         =   "UserDB"
            Shortcut        =   ^U
         End
      End
      Begin VB.Menu ifrger 
         Caption         =   "-"
      End
      Begin VB.Menu rConfig 
         Caption         =   "Reload Config"
         Shortcut        =   ^R
      End
   End
   Begin VB.Menu Connect 
      Caption         =   "Connect"
   End
   Begin VB.Menu Disc 
      Caption         =   "Disconnect"
   End
   Begin VB.Menu Window 
      Caption         =   "Window"
      Begin VB.Menu mnuStatus 
         Caption         =   "Bot Statistics"
         Shortcut        =   ^S
      End
      Begin VB.Menu mnuGames 
         Caption         =   "Extra Entertainment"
         Begin VB.Menu mnuTTT 
            Caption         =   "Tic tac toe"
         End
      End
      Begin VB.Menu rigerig 
         Caption         =   "-"
      End
      Begin VB.Menu mnuTrayMe 
         Caption         =   "Minimize to Tray"
         Shortcut        =   ^M
      End
      Begin VB.Menu ClearChat 
         Caption         =   "Clear chat Window"
         Shortcut        =   ^W
      End
   End
   Begin VB.Menu help 
      Caption         =   "Help"
      Begin VB.Menu About 
         Caption         =   "About vnBot"
         Shortcut        =   ^A
      End
      Begin VB.Menu rMe 
         Caption         =   "The Readme"
         Shortcut        =   ^Y
      End
      Begin VB.Menu wstynjtyj 
         Caption         =   "-"
      End
      Begin VB.Menu Website 
         Caption         =   "Visit Website"
         Shortcut        =   ^I
      End
      Begin VB.Menu mnuReport 
         Caption         =   "Report a Bug/Error"
         Shortcut        =   ^{F11}
      End
      Begin VB.Menu mnuContact 
         Caption         =   "Contact Us"
         Shortcut        =   ^{F12}
      End
   End
End
Attribute VB_Name = "frmChat"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()

Dim authType As String ' Authorization variable
Dim ver As String
Dim rtNews As String
Dim rtGlobal As String

ver = "v2.4"

  vbBrown = 33003
  vbTeal = &HC08000
  vbLightTeal = &HBEAF96
  vbGray = &H8D7B72
  vbBlue2 = 13395456
  vbGrayish = &H675950
  vbOrange = &H53FF
  
  Set dicCommands = CreateObject("Scripting.Dictionary")
  Set configFSO = CreateObject("Scripting.FileSystemObject")
  Set channelFSO = CreateObject("Scripting.FileSystemObject")
  Set dicUserGroup = CreateObject("Scripting.Dictionary")
  Set dicPing = CreateObject("Scripting.Dictionary")
  Set dicClient = CreateObject("Scripting.Dictionary")
  
  rtNews = InetNews.OpenURL("http://vnb.privt.com/botnews/2.4/news.txt")
  
  txtAuth.text = "Authorized VNBot 2.4 Version By: Plugins"
  
  CurrentState = Opaque
  
  ' Set to go from opaque to transparent.
  StartValue = Opaque
  EndValue = Transparent
  Increment = -3
  tmrTransparent.Enabled = True
  
  tmrBotNews.Enabled = True
  EnableURLDetect rtbchat.hWnd, Me.hWnd
  
  If frmConfig.chkConnectStartup.Value = 1 Then
  
    splitNews = Split(rtNews, vbCrLf)
    
    For Each NewLine In splitNews
        AddChat vbRed, "[Bot News]", vbGreen, NewLine
    Next
    
  'Announce Username currently set
  If frmConfig.txtUsername.text = vbNullString Then
    AddChat vbGray, "-- Username: ", vbGreen, "Not Setup"
   Else
    AddChat vbGray, "-- Username: ", vbGreen, frmConfig.txtUsername.text
  End If
  
  'Announce Channel currently set
  If frmConfig.txtHome.text = vbNullString Then
    AddChat vbGray, "-- Home Channel: ", vbGreen, "Not Setup"
   Else
    AddChat vbGray, "-- Home Channel: ", vbGreen, frmConfig.txtHome.text
  End If
  
  'Announce Server/Port currently set
  If frmConfig.txtServer.text = vbNullString Then
    AddChat vbGray, "-- Server/Port: ", vbGreen, "Not Setup"
   Else
    AddChat vbGray, "-- Server/Port: ", vbGreen, frmConfig.txtServer.text, vbGray, ":", vbGreen, frmConfig.txtPort.text
  End If
    
    Me.Caption = "VectorNet Bot v2.4 | By: Plugins -- Connecting... " & Server
    Call Connection_Click
  Else
    splitNews = Split(rtNews, vbCrLf)
    
    For Each NewLine In splitNews
        AddChat vbRed, "[Bot News]", vbGreen, NewLine
    Next
    
      'Announce Username currently set
  If frmConfig.txtUsername.text = vbNullString Then
    AddChat vbGray, "-- Username: ", vbGreen, "Not Setup"
   Else
    AddChat vbGray, "-- Username: ", vbGreen, frmConfig.txtUsername.text
  End If
  
  'Announce Channel currently set
  If frmConfig.txtHome.text = vbNullString Then
    AddChat vbGray, "-- Home Channel: ", vbGreen, "Not Setup"
   Else
    AddChat vbGray, "-- Home Channel: ", vbGreen, frmConfig.txtHome.text
  End If
  
  'Announce Server/Port currently set
  If frmConfig.txtServer.text = vbNullString Then
    AddChat vbGray, "-- Server/Port: ", vbGreen, "Not Setup"
   Else
    AddChat vbGray, "-- Server/Port: ", vbGreen, frmConfig.txtServer.text, vbGray, ":", vbGreen, frmConfig.txtPort.text
  End If
    
    Me.Caption = "VectorNet Bot v2.4 | By: Plugins -- Disconnected!"
    sckVectorNet.Close
  End If
  
  If frmConfig.chkMiniStartup.Value = 1 Then
    tmrDelayMS.Enabled = True
  End If
  
  If frmConfig.chkUpdates.Value = 1 Then
    tmrUpdater.Enabled = True
  End If
  
  'Check if Config.ini is there. If it isn't then create it.
If Not configFSO.FileExists(App.Path & "\" & "Config.ini") Then
      'Write the Config information to the file! (This also creates the file)
       WriteINI "Account", "Username", frmConfig.txtUsername.text, "Config.ini"
       WriteINI "Account", "Password", frmConfig.txtPassword.text, "Config.ini"
       WriteINI "Server", "Host", frmConfig.txtServer.text, "Config.ini"
       WriteINI "Server", "Port", frmConfig.txtPort.text, "Config.ini"
       WriteINI "Extras", "Home Channel", frmConfig.txtHome.text, "Config.ini"
       WriteINI "Extras", "Greet Message", frmConfig.txtGreet.text, "Config.ini"
       WriteINI "Extras", "Idle Message", frmConfig.txtIdle.text, "Config.ini"
       WriteINI "Extras", "Bot Trigger", frmConfig.txtTrigger.text, "Config.ini"
       WriteINI "Extras", "Greet Status", frmConfig.chkGreet.Value, "Config.ini"
       WriteINI "Extras", "Idle Time", frmConfig.txtIdleTime.text, "Config.ini"
       WriteINI "Extras", "Idle Status", frmConfig.chkIdle.Value, "Config.ini"
       WriteINI "Extras", "ConnectOnStartup", frmConfig.chkConnectStartup, "Config.ini"
       WriteINI "Extras", "MinimizeOnStartup", frmConfig.chkMiniStartup, "Config.ini"
       WriteINI "Extras", "CheckUpdatesOnStartup", frmConfig.chkUpdates, "Config.ini"
       WriteINI "Extras", "Whisper Greet", frmConfig.chkWhisperGreet, "Config.ini"
       WriteINI "Advanced", "PingSpoof", frmConfig.chkPingSpoof, "Config.ini"
       WriteINI "Advanced", "CustomPing", frmConfig.txtPing.text, "Config.ini"
       WriteINI "Advanced", "ShowSplash", frmConfig.chkShowSplash, "Config.ini"
       
       'Now read the information to the Config window it self.
       frmConfig.txtUsername.text = ReadINI("Account", "Username", "Config.ini")
       frmConfig.txtPassword.text = ReadINI("Account", "Password", "Config.ini")
       frmConfig.txtServer.text = ReadINI("Server", "Host", "Config.ini")
       frmConfig.txtPort.text = ReadINI("Server", "Port", "Config.ini")
       frmConfig.txtHome.text = ReadINI("Extras", "Home Channel", "Config.ini")
       frmConfig.txtGreet.text = ReadINI("Extras", "Greet Message", "Config.ini")
       frmConfig.txtIdle.text = ReadINI("Extras", "Idle Message", "Config.ini")
       frmConfig.txtTrigger.text = ReadINI("Extras", "Bot Trigger", "Config.ini")
       frmConfig.chkGreet.Value = ReadINI("Extras", "Greet Status", "Config.ini")
       frmConfig.txtIdleTime.text = ReadINI("Extras", "Idle Time", "Config.ini")
       frmConfig.chkIdle.Value = ReadINI("Extras", "Idle Status", "Config.ini")
       frmConfig.chkConnectStartup.Value = ReadINI("Extras", "ConnectOnStartup", "Config.ini")
       frmConfig.chkMiniStartup.Value = ReadINI("Extras", "MinimizeOnStartup", "Config.ini")
       frmConfig.chkUpdates.Value = ReadINI("Extras", "CheckUpdatesOnStartup", "Config.ini")
       frmConfig.chkWhisperGreet.Value = ReadINI("Extras", "Whisper Greet", "Config.ini")
       frmConfig.chkPingSpoof.Value = ReadINI("Advanced", "PingSpoof", "Config.ini")
       frmConfig.txtPing.text = ReadINI("Advanced", "CustomPing", "Config.ini")
       frmConfig.chkShowSplash.Value = ReadINI("Advanced", "ShowSplash", "Config.ini")
       AddChat vbGray, "-- Configuration Created: ", vbGreen, "Config.ini"
       frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
       
    Else
     'Write the information to the Config.ini that is already there!
       WriteINI "Account", "Username", frmConfig.txtUsername.text, "Config.ini"
       WriteINI "Account", "Password", frmConfig.txtPassword.text, "Config.ini"
       WriteINI "Server", "Host", frmConfig.txtServer.text, "Config.ini"
       WriteINI "Server", "Port", frmConfig.txtPort.text, "Config.ini"
       WriteINI "Extras", "Home Channel", frmConfig.txtHome.text, "Config.ini"
       WriteINI "Extras", "Greet Message", frmConfig.txtGreet.text, "Config.ini"
       WriteINI "Extras", "Idle Message", frmConfig.txtIdle.text, "Config.ini"
       WriteINI "Extras", "Bot Trigger", frmConfig.txtTrigger.text, "Config.ini"
       WriteINI "Extras", "Greet Status", frmConfig.chkGreet.Value, "Config.ini"
       WriteINI "Extras", "Idle Time", frmConfig.txtIdleTime.text, "Config.ini"
       WriteINI "Extras", "Idle Status", frmConfig.chkIdle.Value, "Config.ini"
       WriteINI "Extras", "ConnectOnStartup", frmConfig.chkConnectStartup, "Config.ini"
       WriteINI "Extras", "MinimizeOnStartup", frmConfig.chkMiniStartup, "Config.ini"
       WriteINI "Extras", "CheckUpdatesOnStartup", frmConfig.chkUpdates, "Config.ini"
       WriteINI "Extras", "Whisper Greet", frmConfig.chkWhisperGreet, "Config.ini"
       WriteINI "Advanced", "PingSpoof", frmConfig.chkPingSpoof, "Config.ini"
       WriteINI "Advanced", "CustomPing", frmConfig.txtPing.text, "Config.ini"
       WriteINI "Advanced", "ShowSplash", frmConfig.chkShowSplash, "Config.ini"
       
     'Now read it to the Configuration to get the updated info.
       frmConfig.txtUsername.text = ReadINI("Account", "Username", "Config.ini")
       frmConfig.txtPassword.text = ReadINI("Account", "Password", "Config.ini")
       frmConfig.txtServer.text = ReadINI("Server", "Host", "Config.ini")
       frmConfig.txtPort.text = ReadINI("Server", "Port", "Config.ini")
       frmConfig.txtHome.text = ReadINI("Extras", "Home Channel", "Config.ini")
       frmConfig.txtGreet.text = ReadINI("Extras", "Greet Message", "Config.ini")
       frmConfig.txtIdle.text = ReadINI("Extras", "Idle Message", "Config.ini")
       frmConfig.txtTrigger.text = ReadINI("Extras", "Bot Trigger", "Config.ini")
       frmConfig.chkGreet.Value = ReadINI("Extras", "Greet Status", "Config.ini")
       frmConfig.txtIdleTime.text = ReadINI("Extras", "Idle Time", "Config.ini")
       frmConfig.chkIdle.Value = ReadINI("Extras", "Idle Status", "Config.ini")
       frmConfig.chkConnectStartup.Value = ReadINI("Extras", "ConnectOnStartup", "Config.ini")
       frmConfig.chkMiniStartup.Value = ReadINI("Extras", "MinimizeOnStartup", "Config.ini")
       frmConfig.chkUpdates.Value = ReadINI("Extras", "CheckUpdatesOnStartup", "Config.ini")
       frmConfig.chkWhisperGreet.Value = ReadINI("Extras", "Whisper Greet", "Config.ini")
       frmConfig.chkPingSpoof.Value = ReadINI("Advanced", "PingSpoof", "Config.ini")
       frmConfig.txtPing.text = ReadINI("Advanced", "CustomPing", "Config.ini")
       frmConfig.chkShowSplash.Value = ReadINI("Advanced", "ShowSplash", "Config.ini")
  End If
  
  'Check if QuickChannels.txt is there. If it isn't then create it.
  If Not channelFSO.FileExists(App.Path & "\" & "QuickChannels.txt") Then
    'Make the file QuickChannels.txt
     channelFSO.CreateTextFile (App.Path & "\" & "QuickChannels.txt")
     'Write the channels to the QuickChannels.txt
     WriteChannels "Quick Channels", "Channel1", frmQuickJoin.txtChannel1.text
     WriteChannels "Quick Channels", "Channel2", frmQuickJoin.txtChannel2.text
     WriteChannels "Quick Channels", "Channel3", frmQuickJoin.txtChannel3.text
     WriteChannels "Quick Channels", "Channel4", frmQuickJoin.txtChannel4.text
     WriteChannels "Quick Channels", "Channel5", frmQuickJoin.txtChannel5.text
     WriteChannels "Quick Channels", "Channel6", frmQuickJoin.txtChannel6.text
     WriteChannels "Quick Channels", "Channel7", frmQuickJoin.txtChannel7.text
     
     'Then Read them!
    Chan1.Caption = ReadChannels("Quick Channels", "Channel1")
    Chan2.Caption = ReadChannels("Quick Channels", "Channel2")
    Chan3.Caption = ReadChannels("Quick Channels", "Channel3")
    Chan4.Caption = ReadChannels("Quick Channels", "Channel4")
    Chan5.Caption = ReadChannels("Quick Channels", "Channel5")
    Chan6.Caption = ReadChannels("Quick Channels", "Channel6")
    Chan7.Caption = ReadChannels("Quick Channels", "Channel7")
    'Give the message file was created.
     AddChat vbGray, "-- QuickChannels Created ", vbGreen, "QuickChannels.txt"
     frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
     
  Else
  'If the file is there then Write the channels!
    WriteChannels "Quick Channels", "Channel1", frmQuickJoin.txtChannel1.text
    WriteChannels "Quick Channels", "Channel2", frmQuickJoin.txtChannel2.text
    WriteChannels "Quick Channels", "Channel3", frmQuickJoin.txtChannel3.text
    WriteChannels "Quick Channels", "Channel4", frmQuickJoin.txtChannel4.text
    WriteChannels "Quick Channels", "Channel5", frmQuickJoin.txtChannel5.text
    WriteChannels "Quick Channels", "Channel6", frmQuickJoin.txtChannel6.text
    WriteChannels "Quick Channels", "Channel7", frmQuickJoin.txtChannel7.text
    
    'Then read them!
    Chan1.Caption = ReadChannels("Quick Channels", "Channel1")
    Chan2.Caption = ReadChannels("Quick Channels", "Channel2")
    Chan3.Caption = ReadChannels("Quick Channels", "Channel3")
    Chan4.Caption = ReadChannels("Quick Channels", "Channel4")
    Chan5.Caption = ReadChannels("Quick Channels", "Channel5")
    Chan6.Caption = ReadChannels("Quick Channels", "Channel6")
    Chan7.Caption = ReadChannels("Quick Channels", "Channel7")
  End If
  
  If Chan1.Caption = vbNullString Then
    Chan1.Caption = "Channel1"
  End If
  
  If Chan2.Caption = vbNullString Then
    Chan2.Caption = "Channel2"
  End If
  
  If Chan3.Caption = vbNullString Then
    Chan3.Caption = "Channel3"
  End If
  
  If Chan4.Caption = vbNullString Then
    Chan4.Caption = "Channel4"
  End If
  
  If Chan5.Caption = vbNullString Then
    Chan5.Caption = "Channel5"
  End If
  
  If Chan6.Caption = vbNullString Then
    Chan6.Caption = "Channel6"
  End If
  
  If Chan7.Caption = vbNullString Then
    Chan7.Caption = "Channel7"
  End If
  
  Me.Caption = "VectorNet Bot v2.4 | By: Plugins -- Disconnected!"

txtChannel.text = "Not Connected"
txtFriends.text = "Friends online: " & "0"
trigger = frmConfig.txtTrigger.text

'Check if show splash screen is enabled if so then show it
If frmConfig.chkShowSplash.Value = 1 Then
     frmSplash.Show
     frmChat.Hide
  Else
     frmChat.Show
     frmSplash.Hide
End If

End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    If Not Visible Then
        Select Case X \ Screen.TwipsPerPixelX
            Case WM_LBUTTONDBLCLK
                Visible = True
                WindowState = vbNormal
                
                Dim hProcess As Long
                
                GetWindowThreadProcessId hWnd, hProcess
                AppActivate hProcess
        End Select
    End If

End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

On Error Resume Next

'execute regular information.
AddChat vbGray, "Shutting down VectorNet Bot!"
frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1


End Sub

Private Sub Form_Resize()

On Error Resume Next

Dim borderWidth As Single, borderHeight As Single, titleHeight As Single

'Defined Variables
borderWidth = Me.Width - Me.ScaleWidth
borderHeight = Me.Height - Me.ScaleHeight
titleHeight = Me.Height - Me.ScaleHeight - borderWidth / (4)

'Heights
rtbchat.Height = Me.Height - txtSendChat.Height - titleHeight
txtSendChat.Top = rtbchat.Height - lblSpacer2.Height
TabStrip1.Top = rtbchat.Height
ChanList.Height = rtbchat.Height - txtChannel.Height + Label1.Height - Label2.Height - Label2.Height - Label2.Height - Label2.Height - Label2.Height - Label2.Height
FriendsList.Height = rtbchat.Height - txtChannel.Height + Label1.Height - Label2.Height - Label2.Height - Label2.Height - Label2.Height - Label2.Height - Label2.Height
lstAdmins.Height = rtbchat.Height - txtChannel.Height + Label1.Height - Label2.Height - Label2.Height - Label2.Height - Label2.Height - Label2.Height - Label2.Height

'Widths
rtbchat.Width = Me.Width - ChanList.Width - borderWidth
ChanList.Left = rtbchat.Width
FriendsList.Left = rtbchat.Width
lstAdmins.Left = rtbchat.Width
TabStrip1.Left = ChanList.Left
txtChannel.Left = ChanList.Left
txtFriends.Left = FriendsList.Left
txtAdmins.Left = lstAdmins.Left
txtSendChat.Width = rtbchat.Width

End Sub

Private Sub Disc_Click()

    'Disconnect from the current VectorNet Server.
    mnuPopupKick.Enabled = False
    mnuPopupBan.Enabled = False

    sckVectorNet.Close
    tmrCheckState.Enabled = False
    txtChannel.text = "Not Connected"
    ChanList.ListItems.Clear
    lstAdmins.ListItems.Clear
    tmrIdle.Enabled = False
    AddChat vbRed, "All Connections Closed."
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
    
    Me.Caption = "VectorNet Bot v2.4 | By: Plugins -- Disconnected!"
    dicUserGroup.RemoveAll

End Sub

Private Sub Form_Unload(Cancel As Integer)

On Error Resume Next

'Write all the bot info to the files.
       WriteINI "Account", "Username", frmConfig.txtUsername.text, "Config.ini"
       WriteINI "Account", "Password", frmConfig.txtPassword.text, "Config.ini"
       WriteINI "Server", "Host", frmConfig.txtServer.text, "Config.ini"
       WriteINI "Server", "Port", frmConfig.txtPort.text, "Config.ini"
       WriteINI "Extras", "Home Channel", frmConfig.txtHome.text, "Config.ini"
       WriteINI "Extras", "Greet Message", frmConfig.txtGreet.text, "Config.ini"
       WriteINI "Extras", "Idle Message", frmConfig.txtIdle.text, "Config.ini"
       WriteINI "Extras", "Bot Trigger", frmConfig.txtTrigger.text, "Config.ini"
       WriteINI "Extras", "Greet Status", frmConfig.chkGreet.Value, "Config.ini"
       WriteINI "Extras", "Idle Time", frmConfig.txtIdleTime.text, "Config.ini"
       WriteINI "Extras", "Idle Status", frmConfig.chkIdle.Value, "Config.ini"
       WriteINI "Extras", "ConnectOnStartup", frmConfig.chkConnectStartup, "Config.ini"
       WriteINI "Extras", "MinimizeOnStartup", frmConfig.chkMiniStartup, "Config.ini"
       WriteINI "Extras", "CheckUpdatesOnStartup", frmConfig.chkUpdates, "Config.ini"
       WriteINI "Extras", "Whisper Greet", frmConfig.chkWhisperGreet, "Config.ini"
       WriteINI "Advanced", "PingSpoof", frmConfig.chkPingSpoof, "Config.ini"
       WriteINI "Advanced", "CustomPing", frmConfig.txtPing.text, "Config.ini"
       WriteINI "Advanced", "ShowSplash", frmConfig.chkShowSplash, "Config.ini"
       
'Make the bot statistics 0
       frmStatus.txtMsgCount.Caption = "0"
       frmStatus.txtSentCount.Caption = "0"
       frmStatus.txtServerCount.Caption = "0"
       frmStatus.txtErrorCount.Caption = "0"
       frmStatus.txtErrorBotCount.Caption = "0"
       frmStatus.txtMainWindowAddChat.Caption = "0"
       
'write the botstatus.ini to 0
    'Message Count info
    WriteINI "VectorNet Messages", "From Others", txtMsgCount.Caption, "BotStatus.ini"
    WriteINI "VectorNet Messages", "From You", txtSentCount.Caption, "BotStatus.ini"
    WriteINI "VectorNet Messages", "From Server", txtServerCount.Caption, "BotStatus.ini"
    'Error Count info
    WriteINI "VectorNet Errors", "Server Errors", txtErrorCount.Caption, "BotStatus.ini"
    WriteINI "VectorNet Errors", "Bot Errors", txtErrorBotCount.Caption, "BotStatus.ini"
    'Bot AddChat info
    WriteINI "VectorNet AddChats", "Bot AddChats", txtMainWindowAddChat.Caption, "BotStatus.ini"


'close connections
sckVectorNet.Close

'close the windows of VNBot
Dim oFrm As Form
For Each oFrm In Forms
  Unload oFrm
Next

End Sub

Private Sub mnuContact_Click()

AddChat vbGray, "-- ", vbGreen, "Opening: Contact Us"
frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1

CreateObject("WScript.Shell").Run ("http://vnb.privt.com/contact")

End Sub

Private Sub mnuReport_Click()

AddChat vbGray, "-- ", vbGreen, "Opening: Report Bug/Errors"
frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1

CreateObject("WScript.Shell").Run ("http://vnb.privt.com/report/")

End Sub

Private Sub mnuStatus_Click()

frmStatus.Show

End Sub

Private Sub mnuTTT_Click()

frmTicTacToe.Show

End Sub

Private Sub QuickChans_Click()

frmQuickJoin.Show

End Sub

Private Sub rtbchat_KeyPress(KeyAscii As Integer)

txtSendChat.SetFocus

End Sub

Private Sub sckVectorNet_Close()

mnuPopupKick.Enabled = False
mnuPopupBan.Enabled = False
ChanList.ListItems.Clear
txtChannel.text = "Not Connected"
tmrCheckState.Enabled = False
tmrIdle.Enabled = False

Me.Caption = "VectorNet Bot v2.4 | By: Plugins -- Disconnected!"

End Sub

Private Sub sckVectorNet_Connect()
  connectedPing = GetTickCount()
  
  resultingPing = connectedPing - connectingPing
  
  If frmConfig.chkIdle.Value = 1 Then
    tmrIdle.Enabled = True
  End If

Me.Caption = "VectorNet Bot v2.4 | By: Plugins -- Connecting... " & Server

'Winsock Connection
sendPacket &H1, username & Chr$(0) & Password & Chr$(0) & 4

  tmrCheckState.Enabled = False
End Sub

Private Sub sckVectorNet_DataArrival(ByVal bytesTotal As Long)
  
  'All the packets that are sent and recieved from and to VectorNet.
  Dim data As String, pID As String, tempBuf As String
  
  sckVectorNet.GetData data
  tempBuf = tempBuf & data
  
  'pID = Mid(data, 1, 1)
  'data = Mid(data, 2)
  'Call handlePacket(pID, data)
  'Exit Sub
  
  Do While Len(tempBuf) > 0
    pID = Asc(Left(tempBuf, 1))
    tempBuf = Mid(tempBuf, 2)
    pLen = Split(tempBuf, Chr$(0))(0)
    tempBuf = Mid(tempBuf, InStr(tempBuf, Chr$(0)) + 1)
    Call handlePacket(pID, IIf(Len(tempBuf) > 0, Mid(tempBuf, 1, pLen), vbNullString))
    tempBuf = Mid(tempBuf, pLen + 1)
  Loop
  
End Sub

Private Sub handlePacket(ByVal pID As Byte, ByVal data As String)

  Select Case pID
    Case &H1
    
            Dim tempGreet As String
            Dim ver As String
  
            ver = ":: Using VectorNet bot v2.4 by Plugins ::"
            
            userjoin = Split(data, Chr$(0))(0)
            cType = Split(data, Chr$(0))(1)
            cPing = Split(data, Chr$(0))(2)
            cChannel = Split(data, Chr$(0))(3)
             
            Select Case cType
              Case 1: Client = "(VectorNet Client)"
              Case 2: Client = "(StealthBot Plugin)"
              Case 3: Client = "(VectorBot Client)"
              Case 4: Client = "(VectorNet Bot by Jd)"
              Case 5: Client = "(FailBot client)"
              Case 6: Client = "(RiffBot by RiffRuff)"
              Case 7: Client = "(Unkown by JPT)"
              Case 8: Client = "(VectorNet Queue Slave)"
              Case 9: Client = "(LynxVN Client by Lynxy)"
              Case Else: Client = "(Unknown client)"
            End Select
            
            AddChat vbGray, "-- " & userjoin, vbYellow, " [" & cPing & "ms]", vbGreen, " has joined VectorNet using ", vbYellow, Client
            frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
            
            Set dicClient.Item(LCase(remSpecial(userjoin))) = New clsUserData
            
            With dicClient.Item(LCase(remSpecial(userjoin)))
              .Client = Client
              .ping = cPing
            End With
            
            lstAdmins.ListItems.Clear
            
            For Each key In dicUserGroup.keys
               If dicUserGroup.Item(key) = "admin" Then
                 lstAdmins.ListItems.Add , , key, , 1
               End If
            Next
            
            If LCase(currentChannel) <> LCase(cChannel) Then Exit Sub
            
            Select Case Left(userjoin, 1)
              Case "%": dicUserGroup.Item(Mid(userjoin, 2)) = "admin"
              Case "@": dicUserGroup.Item(Mid(userjoin, 2)) = "moderator"
              Case Else: dicUserGroup.Item(userjoin) = "regular"
            End Select
            
            ChanList.ListItems.Clear
            Call addToUserList
            
                        tempGreet = frmConfig.txtGreet.text
    
            tempGreet = Replace(tempGreet, "%v", ver)
            tempGreet = Replace(tempGreet, "%me", username)
            tempGreet = Replace(tempGreet, "%c", currentChannel)
            tempGreet = Replace(tempGreet, "%utj", userjoin)
            tempGreet = Replace(tempGreet, "%uct", Client)
            tempGreet = Replace(tempGreet, "%up", ping)
            
            If frmConfig.chkGreet.Value = 1 Then
             If frmConfig.chkWhisperGreet.Value = 1 Then
                Call processCommand("/w " & userjoin & " " & tempGreet)
                frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
              Else
                sendPacket &H2, username & Chr$(0) & tempGreet
                AddChat vbTeal, "<", vbOrange, username, vbTeal, "> ", vbWhite, tempGreet
                frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
                
            End If
           End If
           
           txtChannel.text = currentChannel & " [" & ChanList.ListItems.Count & "]"
            
    Case &H2
              Dim trigname As String
              trigname = "Current trigger is: "
              
              user = Split(data, Chr$(0))(0)
              text = Split(data, Chr$(0))(1)
              
              testUser = Replace(user, "@", "")
              testUser = Replace(testUser, "%", "")
              
              AddChat vbTeal, "<", vbYellow, user, vbTeal, "> ", vbWhite, text
              frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
              
              Call processOutCommand(testUser, text)
              
              If text = "?trigger" Then
                AddChat vbTeal, "<", vbOrange, username, vbTeal, "> ", vbGray, "(Bot Command): Current trigger is, " & frmConfig.txtTrigger.text
                frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
                
                sendPacket &H2, username & Chr$(0) & trigname & frmConfig.txtTrigger.text
              End If
              
              'Send the message count update to the statistics in the bot by "1"
              frmStatus.txtMsgCount.Caption = frmStatus.txtMsgCount.Caption + 1
    
    Case &H3
                Message = Split(data, Chr$(0))(0)
                MessageCode = Split(data, Chr$(0))(1)
                
                Select Case MessageCode
                  Case 0:
                            'Send the error given by the server
                            AddChat vbYellow, "<Server Error> ", vbTeal, Message
                            frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
                            
                            'Send the error count update to the statistics in the bot by "1"
                            frmStatus.txtErrorCount.Caption = frmStatus.txtErrorCount.Caption + 1
                  Case 1:
                            'Send the info by the server
                            AddChat vbYellow, "<Server Info> ", vbGray, Message
                            frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
                            
                            'Send the server message count update to the statistics in the bot by "1"
                            frmStatus.txtServerCount.Caption = frmStatus.txtServerCount.Caption + 1

                End Select
                
    Case &H4
                userLeave = data
                
                For i = 0 To ChanList.ListItems.Count - 1
                  If LCase(remSpecial(userLeave)) = LCase(ChanList.ListItems.Item(i + 1)) Then
                    ChanList.ListItems.Remove (i + 1)
                    Exit For
                  End If
                Next i
                
                AddChat vbGray, "-- " & userLeave, vbGreen, " has left VectorNet."
                frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
                
                
                txtChannel.text = currentChannel & " [" & ChanList.ListItems.Count & "]"
                
                If dicClient.Exists(LCase(remSpecial(userLeave))) Then
                  dicClient.Remove (LCase(remSpecial(userLeave)))
                End If
                
                If dicUserGroup.Exists(remSpecial(userLeave)) Then
                  dicUserGroup.Remove (remSpecial(userLeave))
                End If
    
    Case &H5
    
             VNVer = Split(data, Chr$(0))(0)
             authType = Split(data, Chr$(0))(1)
             
             totalusersvn = "Total Users Online: "

             Select Case authType
               Case "admin": addName = "%" & username
               Case "moderator": addName = "@" & username
               Case Else: addName = username
             End Select

             Select Case authType
               Case "admin", "moderator"
                    mnuPopupKick.Enabled = True
                    mnuPopupBan.Enabled = True
             End Select
            
            AddChat vbGreen, "[VNB] Bot Connected!"
            Call checklogin
            frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
            
            Me.Caption = "VectorNet Bot v2.4 | By: Plugins -- Connected!"
            
            txtChannel.text = currentChannel & " [" & ChanList.ListItems.Count & "]"
  
  Case &H6
            servertxt = data
            
            AddChat vbYellow, "<Server Message> ", vbTeal, servertxt
            frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
            frmStatus.txtServerCount.Caption = frmStatus.txtServerCount.Caption + 1
  
  Case &H7
            GetUser = Split(data, Chr$(0))(0)
            getValue = Split(data, Chr$(0))(1)

            getPing = Split(getValue, "|")(0)
            getProduct = Split(getValue, "|")(1)
            getChannel = Split(getValue, "|")(2)
            
            AddChat vbGray, "-- ", vbGreen, GetUser, vbYellow, ", is using ", vbGreen, getProduct, vbYellow, " in ", vbGreen, getChannel, vbYellow, " | Logon Ping: ", vbGreen, getPing, vbYellow, " ms"
            frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
            
  Case &H8
            Call frmTicTacToe.handleOutsideEvents(data)
  
  Case &H9
            userList = data

            ChanList.ListItems.Clear
            reorderUsers (userList)
            
            For Each key In dicUserGroup.keys
               If dicUserGroup.Item(key) = "admin" Then
                 lstAdmins.ListItems.Add , , key, , 1
               End If
            Next
            
            txtChannel.text = currentChannel & " [" & ChanList.ListItems.Count & "]"
            
  Case &H11
            totalusers = Split(data, Chr$(0))(0)
            totalchannels = Split(data, Chr$(0))(1)
            usersString = Split(data, Chr$(0))(2)
            
            AddChat vbGray, "Users Online: ", vbGreen, totalusers & " ", vbGray, "Channels Used: ", vbGreen, totalchannels & " ", vbGray, "Users on VectorNet: ", vbGreen, usersString
            frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
  
  Case &H12
            Select Case requestType
              Case "whisper"
                Call handleWhisper(data)
              Case "ticlist"
                Call frmTicTacToe.addToCombo(data)
            End Select
            
  Case &HA
            AddChat vbGreen, "[VNET] ", vbYellow, "Account does not exist.. (Account Created)!"
            frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
  
  Case &HB
            sendPacket &HB, vbNullString
  
  Case &HC
             user = data
             user = Replace(user, "@", "")
             user = Replace(user, "%", "")
             
             For i = 0 To ChanList.ListItems.Count
               getThem = Replace(getThem, "@", "")
               getThem = Replace(getThem, "%", "")
               
               If LCase(user) = LCase(getThem) Then
                 ChanList.ListItems.Remove (i + 1)
                 Exit For
               End If
             Next i
             
             If dicUserGroup.Exists(user) Then
               dicUserGroup.Remove (user)
             End If
             
             AddChat vbGray, "-- " & user, vbGreen, " has left the Channel."
             frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
             
             txtChannel.text = currentChannel & " [" & ChanList.ListItems.Count & "]"
             
             If txtChannel.text = "The Void" Then
              If frmConfig.txtBackChannel.text = vbNullString Then
                Exit Sub
               Else
                 sendPacket &HC, username & Chr$(0) & frmConfig.txtBackChannel.text
             End If
            End If
  
  Case &HD
            ChanName = Split(data, Chr$(0))(0)
            chanCode = Split(data, Chr$(0))(1)
            
            Select Case chanCode
              Case "success"
                AddChat vbGray, "-- Joined channel: ", vbGreen, ChanName
                frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
                
                currentChannel = ChanName
                dicUserGroup.RemoveAll
                dicUserGroup.Item(username) = authType
                sendPacket &H9, vbNullString
            End Select
            
  Case &HE
            fromUser = Split(data, Chr$(0))(0)
            text = Split(data, Chr$(0))(1)
            
            AddChat vbBrown, "<From ", vbYellow, fromUser, vbBrown, "> ", vbGray, text
            frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
            
            lastWhispered = fromUser
            
  Case &HF
            getThem = data
            
            If dicClient.Exists(LCase(remSpecial(getThem))) Then
              Client = dicClient.Item(LCase(remSpecial(getThem))).Client
              ping = dicClient.Item(LCase(remSpecial(getThem))).ping
            End If
 
            AddChat vbGray, "-- " & remSpecial(getThem), vbYellow, " [" & ping & "ms]", vbGreen, " has joined the channel."
            frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
            
            Call addUserToList(getThem)
  End Select

End Sub

Private Sub tmrBotNews_Timer()

rtNews = InetNews.OpenURL("http://vnb.privt.com/botnews/2.4/news.txt")

InetNews.Cancel
InetNews.RequestTimeout = 5

tmrBotNews.Enabled = False

End Sub

Private Sub tmrCheckState_Timer()
  
  If sckVectorNet.State = sckConnected Then
    Me.Caption = "VectorNet Bot v2.4 | By: Plugins -- Connected!"
  End If

  tmrCheckState.Enabled = False
  
End Sub

Private Sub tmrIdle_Timer()
  
  Dim tempIdle As String
  Dim ver As String
  Dim whisp As String
  
  ver = ":: Using VectorNet bot v2.4 by Plugins ::"
  
If sckVectorNet.State = sckConnected Then
  If tmrCount = frmConfig.txtIdleTime.text - 1 Then
    tempIdle = frmConfig.txtIdle.text
    
     tempIdle = Replace(tempIdle, "%v", ver)
     tempIdle = Replace(tempIdle, "%me", username)
     tempIdle = Replace(tempIdle, "%c", currentChannel)
     
        sendPacket &H2, username & Chr$(0) & tempIdle
        AddChat vbTeal, "<", vbOrange, username, vbTeal, "> ", vbWhite, tempIdle
        frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
        
    tmrCount = 0
Else
    tmrCount = tmrCount + 1
 End If
Else
    Exit Sub
End If

End Sub

Private Sub tmrTransparent_Timer()

  Static BeenHereB4 As Boolean
  Dim lStyle As Long
  If Not BeenHereB4 Then
    lStyle = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
    lStyle = lStyle Or WS_EX_LAYERED
    SetWindowLong Me.hWnd, GWL_EXSTYLE, lStyle
    BeenHereB4 = True
  End If
  CurrentState = CurrentState + Increment
  If CurrentState < 0 Then CurrentState = 0
  If CurrentState > 255 Then CurrentState = 255
  SetLayeredWindowAttributes Me.hWnd, 0, CurrentState, LWA_ALPHA
  If (Increment > 0 And CurrentState >= EndValue) _
  Or (Increment < 0 And CurrentState <= EndValue) _
  Then
    tmrTransparent.Enabled = False
    
    If EndValue = Invisible Then
      Unload Me
    End If
  End If

End Sub

Private Sub tmrUpdater_Timer()

frmUpdater.Show
frmUpdater.tmrAutoUpdater.Enabled = True
tmrUpdater.Enabled = False

End Sub

Private Sub txtChannel_KeyPress(KeyAscii As Integer)

txtSendChat.SetFocus

End Sub

Private Sub txtFriends_KeyPress(KeyAscii As Integer)

txtSendChat.SetFocus

End Sub

Private Sub txtVNStats_KeyPress(KeyAscii As Integer)

txtSendChat.SetFocus

End Sub

Private Sub UpdateChecker_Click()

frmUpdater.Show

End Sub

Private Sub txtSendChat_KeyUp(KeyCode As Integer, Shift As Integer)
  Dim clipText As String
  
  If KeyCode = 86 And Shift = 2 Then
    clipText = Clipboard.GetText
    
    arrLines = Split(clipText, vbCrLf)
    
    For i = 0 To UBound(arrLines)
      If Left(arrLines(i), 1) = "/" Then
        Call processCommand(arrLines(i))
        txtSendChat.text = vbNullString
      Else
        AddChat vbTeal, "<", vbOrange, username, vbTeal, "> ", vbWhite, arrLines(i)
        sendPacket &H2, username & Chr$(0) & arrLines(i)
        txtSendChat.AddItem arrLines(i)
        txtSendChat.text = vbNullString
      End If
    Next i
  End If
  
End Sub

Private Sub UserD_Click()

CreateObject("Shell.Application").Open (App.Path & "\" & "Users.txt")

End Sub

Private Sub UserDB_Click()

frmUserDB.Show

End Sub

Private Sub UserProfile_Click()

frmProfile.Show

frmProfile.lblUsername.Caption = ChanList.SelectedItem

End Sub

Private Sub Website_Click()

AddChat vbWhite, "Launching VectorNet Bot Website!"
frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1

CreateObject("wscript.shell").Run ("http://forums.rev77.net/index.php?showforum=122")

End Sub

Public Sub checklogin()

If sckVectorNet.State = sckConnected Then
  If frmConfig.chkPingSpoof.Value = 1 Then
    AddChat vbRed, "Logged in as: ", vbYellow, username, vbGreen, " [" & frmConfig.txtPing.text & "ms]"
    sendPacket &H11, vbNullString
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
  Else
    AddChat vbRed, "Logged in as: ", vbYellow, username, vbGreen, " [" & resultingPing & "ms]"
    sendPacket &H11, vbNullString
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
  End If
End If

End Sub

Private Sub Form_minimizeNow()

  Dim i As Integer
  Dim s As String
  Dim nid As NOTIFYICONDATA

  s = "VectorNet Bot v2.4 - " & username
  nid = setNOTIFYICONDATA(Me.hWnd, vbNull, NIF_MESSAGE Or NIF_ICON Or NIF_TIP, WM_MOUSEMOVE, Me.Icon, s)
  i = Shell_NotifyIconA(NIM_ADD, nid)

  WindowState = vbMinimized
  Visible = False
  
  If WM_LBUTTONDBLCLK Then
    Visible = True
  End If
  
End Sub

Private Sub CfUs_Click()

frmUpdater.Show

End Sub

Private Sub ChanList_DblClick()

If sckVectorNet.State = sckConnected Then
  txtSendChat.text = txtSendChat.text & ChanList.SelectedItem
Else
  Exit Sub
End If

End Sub

Private Sub ChanList_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

If sckVectorNet.State = sckConnected Then
    mnuPopup.Enabled = True
If Button = 2 Then ' when user clicks the right button on mouse
PopupMenu mnuPopup ' send the popup box!
End If
Else
    mnuPopup.Enabled = False
End If

End Sub

Private Sub ExitVNB_Click()

Unload Me

End Sub

Private Sub About_Click()

frmAbout.Show

End Sub

Private Sub aFlags_Click()

frmAboutaFlags.Show

End Sub

Private Sub BCmds_Click()

frmAboutCmds.Show

End Sub

Private Sub BotFolder_Click()

CreateObject("Shell.Application").Open (App.Path & "\")

End Sub

Private Sub Chan1_Click()

If sckVectorNet.State = sckConnected Then
    sendPacket &HC, username & Chr$(0) & Chan1.Caption
Else
    AddChat vbRed, "You must be connected first!"
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
End If

End Sub

Private Sub Chan2_Click()

If sckVectorNet.State = sckConnected Then
    sendPacket &HC, username & Chr$(0) & Chan2.Caption
Else
    AddChat vbRed, "You must be connected first!"
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
End If

End Sub

Private Sub Chan3_Click()

If sckVectorNet.State = sckConnected Then
    sendPacket &HC, username & Chr$(0) & Chan3.Caption
Else
    AddChat vbRed, "You must be connected first!"
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
End If

End Sub

Private Sub Chan4_Click()

If sckVectorNet.State = sckConnected Then
    sendPacket &HC, username & Chr$(0) & Chan4.Caption
Else
    AddChat vbRed, "You must be connected first!"
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
End If

End Sub

Private Sub Chan5_Click()

If sckVectorNet.State = sckConnected Then
    sendPacket &HC, username & Chr$(0) & Chan5.Caption
Else
    AddChat vbRed, "You must be connected first!"
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
End If

End Sub

Private Sub Chan6_Click()

If sckVectorNet.State = sckConnected Then
    sendPacket &HC, username & Chr$(0) & Chan6.Caption
Else
    AddChat vbRed, "You must be connected first!"
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
End If

End Sub

Private Sub Chan7_Click()

If sckVectorNet.State = sckConnected Then
    sendPacket &HC, username & Chr$(0) & Chan7.Caption
Else
    AddChat vbRed, "You must be connected first!"
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
End If

End Sub

Private Sub ChanList_KeyPress(KeyAscii As Integer)

txtSendChat.SetFocus
    

End Sub

Private Sub mnuPopupBan_Click()

If txtSendChat.text = vbNullString Then
        sendPacket &H2, username & Chr$(0) & "/ban " & ChanList.SelectedItem
    Else
        sendPacket &H2, username & Chr$(0) & "/ban " & ChanList.SelectedItem & " " & txtSendChat.text
        txtSendChat.text = ""
End If


End Sub

Private Sub mnuPopupKick_Click()

If txtSendChat.text = vbNullString Then
        sendPacket &H2, username & Chr$(0) & "/kick " & ChanList.SelectedItem
     Else
        sendPacket &H2, username & Chr$(0) & "/kick " & ChanList.SelectedItem & " " & txtSendChat.text
        txtSendChat.text = ""
End If

End Sub

Private Sub mnuPopupWhisper_Click()

If frmChat.sckVectorNet.State <> sckConnected Then Exit Sub

whisperTo = frmChat.ChanList.SelectedItem

frmChat.txtSendChat.AddItem txtSendChat.text
Call processCommand("/whisper " & whisperTo & " " & frmChat.txtSendChat.text)
frmChat.txtSendChat.text = ""

End Sub

Private Sub mnuPopupWhois_Click()

GetUser = ChanList.SelectedItem

sendPacket &H7, GetUser

End Sub

Private Sub mnuTrayMe_Click()

'Check if form has been minimize, and if it has then do tray
Call Form_minimizeNow

End Sub

Private Sub ProfileEdit_Click()

frmProfile.Show

End Sub

Private Sub rConfig_Click()

Set configFSO = CreateObject("Scripting.FileSystemObject")

If Not configFSO.FileExists(App.Path & "\" & "Config.ini") Then
      'Write the Config information to the file! (This also creates the file)
       WriteINI "Account", "Username", frmConfig.txtUsername.text, "Config.ini"
       WriteINI "Account", "Password", frmConfig.txtPassword.text, "Config.ini"
       WriteINI "Server", "Host", frmConfig.txtServer.text, "Config.ini"
       WriteINI "Server", "Port", frmConfig.txtPort.text, "Config.ini"
       WriteINI "Extras", "Home Channel", frmConfig.txtHome.text, "Config.ini"
       WriteINI "Extras", "Greet Message", frmConfig.txtGreet.text, "Config.ini"
       WriteINI "Extras", "Idle Message", frmConfig.txtIdle.text, "Config.ini"
       WriteINI "Extras", "Bot Trigger", frmConfig.txtTrigger.text, "Config.ini"
       WriteINI "Extras", "Greet Status", frmConfig.chkGreet.Value, "Config.ini"
       WriteINI "Extras", "Idle Time", frmConfig.txtIdleTime.text, "Config.ini"
       WriteINI "Extras", "Idle Status", frmConfig.chkIdle.Value, "Config.ini"
       WriteINI "Extras", "ConnectOnStartup", frmConfig.chkConnectStartup, "Config.ini"
       WriteINI "Extras", "MinimizeOnStartup", frmConfig.chkMiniStartup, "Config.ini"
       WriteINI "Extras", "CheckUpdatesOnStartup", frmConfig.chkUpdates, "Config.ini"
       WriteINI "Extras", "Whisper Greet", frmConfig.chkWhisperGreet, "Config.ini"
       WriteINI "Advanced", "PingSpoof", frmConfig.chkPingSpoof, "Config.ini"
       WriteINI "Advanced", "CustomPing", frmConfig.txtPing.text, "Config.ini"
       WriteINI "Advanced", "ShowSplash", frmConfig.chkShowSplash, "Config.ini"
    Else
'Reload the configuratio by reading the config.ini again
       frmConfig.txtUsername.text = ReadINI("Account", "Username", "Config.ini")
       frmConfig.txtPassword.text = ReadINI("Account", "Password", "Config.ini")
       frmConfig.txtServer.text = ReadINI("Server", "Host", "Config.ini")
       frmConfig.txtPort.text = ReadINI("Server", "Port", "Config.ini")
       frmConfig.txtHome.text = ReadINI("Extras", "Home Channel", "Config.ini")
       frmConfig.txtGreet.text = ReadINI("Extras", "Greet Message", "Config.ini")
       frmConfig.txtIdle.text = ReadINI("Extras", "Idle Message", "Config.ini")
       frmConfig.txtTrigger.text = ReadINI("Extras", "Bot Trigger", "Config.ini")
       frmConfig.chkGreet.Value = ReadINI("Extras", "Greet Status", "Config.ini")
       frmConfig.txtIdleTime.text = ReadINI("Extras", "Idle Time", "Config.ini")
       frmConfig.chkIdle.Value = ReadINI("Extras", "Idle Status", "Config.ini")
       frmConfig.chkConnectStartup.Value = ReadINI("Extras", "ConnectOnStartup", "Config.ini")
       frmConfig.chkMiniStartup.Value = ReadINI("Extras", "MinimizeOnStartup", "Config.ini")
       frmConfig.chkUpdates.Value = ReadINI("Extras", "CheckUpdatesOnStartup", "Config.ini")
       frmConfig.chkWhisperGreet.Value = ReadINI("Extras", "Whisper Greet", "Config.ini")
       frmConfig.chkPingSpoof.Value = ReadINI("Advanced", "PingSpoof", "Config.ini")
       frmConfig.txtPing.text = ReadINI("Advanced", "CustomPing", "Config.ini")
       frmConfig.chkShowSplash.Value = ReadINI("Advanced", "ShowSplash", "Config.ini")
End If

'Send the message it's done
AddChat vbGray, "-- Configuration (Config.ini): ", vbGreen, "Reloaded Successfully!"
frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1

End Sub

Private Sub rMe_Click()
 
CreateObject("wscript.shell").Run ("http://vnb.privt.com/2.4/readme")

End Sub

Private Sub sckVectorNet_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)

Me.Caption = "VectorNet Bot v2.4 | By: Plugins -- Disconnected!"
 AddChat vbRed, "[VNLS] Error #" & Number & ": ", vbRed, Description
 frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
 
 ChanList.ListItems.Clear
 
 'Send the bot error count to the statistics by "1"
 frmStatus.txtErrorBotCount.Caption = frmStatus.txtErrorBotCount.Caption + 1
sckVectorNet.Close
  
End Sub

Private Sub TabStrip1_Click()

Select Case TabStrip1.SelectedItem
    Case "Friends List"
        ChanList.Visible = False
        txtChannel.Visible = False
        lstAdmins.Visible = False
        txtAdmins.Visible = False
        FriendsList.Visible = True
        txtFriends.Visible = True

    Case "Admins"
        lstAdmins.Visible = True
        txtAdmins.Visible = True
        ChanList.Visible = False
        txtChannel.Visible = False
        FriendsList.Visible = False
        txtFriends.Visible = False

    Case Else
        ChanList.Visible = True
        txtChannel.Visible = True
        FriendsList.Visible = False
        txtFriends.Visible = False
        lstAdmins.Visible = False
        txtAdmins.Visible = False

        txtChannel.text = "Not Connected!" 'reset channel caption

    If sckVectorNet.State = sckConnected Then
        txtChannel.text = currentChannel & " [" & ChanList.ListItems.Count & "]"
     Else
        txtChannel.text = "Not Connected!"
    End If

    If sckVectorNet.State = sckConnected Then
        txtAdmins.text = "Total Server (Admins)"
     Else
        txtAdmins.text = "Not Connected!"
    End If

End Select

End Sub

Private Sub tmrDelayMS_Timer()

Me.WindowState = vbMinimized
tmrDelayMS.Enabled = False

End Sub

Private Sub txtSendChat_Change()

  If LCase(txtSendChat.text) = "/r " Or LCase(txtSendChat.text) = "/reply " Then
    If lastWhispered <> vbNullString Then
      txtSendChat.text = "/w " & lastWhispered & " "
      txtSendChat.SelStart = Len(txtSendChat.text)
    End If
  End If
  
End Sub

Private Sub txtSendChat_KeyPress(KeyAscii As Integer)
Dim ver As String
ver = "VectorNet bot v2.4 by Plugins"

If txtSendChat.text = vbNullString Then Exit Sub

  If KeyAscii = 13 Then
    If Left(txtSendChat.text, 1) = "/" Then
      Call processCommand(txtSendChat.text)
      txtSendChat.text = ""
      txtSendChat.AddItem txtSendChat.text
    Else
    If sckVectorNet.State <> sckConnected Then
      txtSendChat.text = ""
       Exit Sub
  End If
    
      sendPacket &H2, username & Chr$(0) & txtSendChat.text
      AddChat vbTeal, "<", vbOrange, addName, vbTeal, "> ", vbWhite, txtSendChat.text
      frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
      
      txtSendChat.AddItem txtSendChat.text
      txtSendChat.text = ""
      frmStatus.txtSentCount.Caption = frmStatus.txtSentCount.Caption + 1
   End If
  End If
  
End Sub

Private Sub ClearChat_Click()

'clear the chat window.
rtbchat.text = ""
AddChat vbGreen, "Chat window has been cleared."
frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1

End Sub

Private Sub Config_Click()

frmConfig.Show

End Sub

Private Sub Configini_Click()

CreateObject("Shell.Application").Open (App.Path & "\Config.ini")

End Sub

Private Sub Connect_Click()

'connect to the Currently set VectorNet Server.
  username = frmConfig.txtUsername.text
  Password = frmConfig.txtPassword.text
  Server = frmConfig.txtServer.text
  Port = frmConfig.txtPort.text
  
  If frmConfig.chkConnectStartup.Value = 1 Then
      Me.Caption = "VectorNet Bot v2.4 | By: Plugins -- Connecting... " & Server
    Else
      Me.Caption = "VectorNet Bot v2.4 | By: Plugins -- Disconnected!"
  End If

'Check if the server is empty, if so then set the server as vectornet.no-ip.org
If frmConfig.txtServer.text = vbNullString Then
    Server = "VectorNet.no-ip.org"
End If
  
'Start the connection protocol to VectorNet
    AddChat vbYellow, "[VNB] ", vbGreen, "Connecting your bot..."
    AddChat vbGreen, "[VNB] ", vbYellow, "Checking bot version..."
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 2
    
    
'Check if the bot is authorized and not tampored with.
 If txtAuth.text = "Authorized VNBot 2.4 Version By: Plugins" Then
    AddChat vbYellow, "[VNB] ", vbGreen, "Bot version accepted!"
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
    
  Else
    AddChat vbYellow, "[VNB] ", vbRed, "Bot version invalid!"
    AddChat vbRed, "Your bot seems to have a authorization issue. Redownload your client and try again."
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 2
    
  Exit Sub
 End If
 
    AddChat vbGreen, "[VNET] ", vbYellow, "Connecting to the VectorNet server at: ", vbGray, Server
    AddChat vbYellow, "[VNET] ", vbGreen, "Sending login information..."
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 2
    
    sckVectorNet.Close
     connectingPing = GetTickCount()
      sckVectorNet.Connect Server, Port
 
  tmrCheckState.Enabled = True
    
If frmConfig.txtServer.text = "localhost" Then
    Server = "127.0.0.1"
End If

    ChanList.ListItems.Clear
    
End Sub

Private Sub Connection_Click()

'connect to the Currently set VectorNet Server.
  username = frmConfig.txtUsername.text
  Password = frmConfig.txtPassword.text
  Server = frmConfig.txtServer.text
  Port = frmConfig.txtPort.text
  
If frmConfig.chkConnectStartup.Value = 1 Then
      Me.Caption = "VectorNet Bot v2.4 | By: Plugins -- Connecting... " & Server
  Else
      Me.Caption = "VectorNet Bot v2.4 | By: Plugins -- Disconnected!"
End If

'Check if the server is empty, if so then set the server as vectornet.no-ip.org
If frmConfig.txtServer.text = vbNullString Then
    Server = "VectorNet.no-ip.org"
End If
  
'Start the connection protocol to VectorNet
    AddChat vbYellow, "[VNB] ", vbGreen, "Connecting your bot..."
    AddChat vbGreen, "[VNB] ", vbYellow, "Checking bot version..."
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 2
    
    
'Check if the bot is authorized and not tampored with.
 If txtAuth.text = "Authorized VNBot 2.4 Version By: Plugins" Then
    AddChat vbYellow, "[VNB] ", vbGreen, "Bot version accepted!"
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 1
  Else
    AddChat vbYellow, "[VNB] ", vbRed, "Bot version invalid!"
    AddChat vbRed, "Your bot seems to have a authorization issue. Redownload your client and try again."
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 2
  Exit Sub
 End If
 
    AddChat vbGreen, "[VNET] ", vbYellow, "Connecting to the VectorNet server at: ", vbGray, Server
    AddChat vbYellow, "[VNET] ", vbGreen, "Sending login information..."
    frmStatus.txtMainWindowAddChat.Caption = frmStatus.txtMainWindowAddChat.Caption + 2
    
    sckVectorNet.Close
     connectingPing = GetTickCount()
      sckVectorNet.Connect Server, Port
 
  tmrCheckState.Enabled = True
    
If frmConfig.txtServer.text = "localhost" Then
    Server = "127.0.0.1"
End If

    ChanList.ListItems.Clear

End Sub

Private Sub Disconnection_Click()

    'Disconnect from the current VectorNet Server.
    mnuPopupKick.Enabled = False
    mnuPopupBan.Enabled = False

    sckVectorNet.Close
    tmrCheckState.Enabled = False
    txtChannel.text = "Not Connected"
    ChanList.ListItems.Clear
    lstAdmins.ListItems.Clear
    tmrIdle.Enabled = False
    AddChat vbRed, "All Connections Closed."
    
    Me.Caption = "VectorNet Bot v2.4 | By: Plugins -- Disconnected!"
    dicUserGroup.RemoveAll

End Sub
